﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AAA.Algorithm.Data
{
    public class Weight : IWeight
    {
        private Dictionary<string, float> _dicWeight;

        public Weight()
        {
            _dicWeight = new Dictionary<string, float>();
        }

        #region IWeight Members

        public float GetFactorWeight(string strName)
        {
            return _dicWeight.ContainsKey(strName)
                    ? _dicWeight[strName]
                    : 0;
        }

        public void SetFactorWeight(string strName, float fWeight)
        {
            if (_dicWeight.ContainsKey(strName))
                _dicWeight[strName] = fWeight;
            else
                _dicWeight.Add(strName, fWeight);
        }

        #endregion
    }
}
